<template>
  <web-view :src="src"></Web-view>
</template>
<script setup>
import { HOST } from '@/utils/config';
import { WebView } from '@tarojs/components';
import { useLoad } from '@tarojs/taro';
import { getCurrentInstance, reactive, ref } from 'vue';

const src = ref(HOST.value);

useLoad(options => {
  if (options.url) {
    options.url = decodeURIComponent(options.url);
    if (!options.url.startsWith('http')) {
      if (!options.url.startsWith('/')) {
        options.url = '/' + options.url;
      }
      options.url = HOST.value + options.url;
    }
    src.value = options.url;
  }
});
</script>
